package com.xy.tool.concurrent.locks.rdb;

import com.xy.tool.concurrent.locks.DisLock;
import com.xy.tool.concurrent.locks.DisLockFactory;
import com.xy.tool.concurrent.locks.rdb.dao.DisLockDao;

import java.util.Objects;

public class RdbDisLockFactory implements DisLockFactory {

    private final DisLockDao disLockDao;

    public RdbDisLockFactory(DisLockDao disLockDao) {
        Objects.requireNonNull(disLockDao);
        this.disLockDao = disLockDao;
    }

    @Override
    public DisLock create() {
        return new RdbDisLock(disLockDao);
    }

}
